import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * 每一行代码，都是改变世界的力量
 *
 * @author 郭帅
 * @date 2022/11/11 17:06
 */
public class AllOfTest {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<Void> a = CompletableFuture.runAsync(() -> {
            System.out.println("A-我执行完了");
        });
        CompletableFuture<Void> b = CompletableFuture.runAsync(() -> {
            System.out.println("B-我也执行完了");
        });
        Void join = CompletableFuture.allOf(a, b).get();
        System.out.println(join);
    }
}
